<script setup lang="ts">
import { onActivated, onMounted } from 'vue'
defineOptions({
  name: 'task-detail'
})
const downloadFile = () => {
  const url = 'https://res.cqnews.net/url/1528/2024/1/22/YesoCW5ITodfoKerODPyuvk1cvkkOOvIkeY.docx',
    fileName = 'txt'
  const link = document.createElement('a')
  link.style.display = 'none'
  document.body.appendChild(link)
  link.href = url
  link.download = fileName
  link.click()
  document.body.removeChild(link)
}

onActivated(() => {
  console.log('onActivated detail')
})
onMounted(() => {
  console.log('mounted detail')
})
</script>
<template>
  <div>
    详情
    <a-button @click="downloadFile">download</a-button>
  </div>
</template>
<style scoped lang="scss"></style>
